<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    Route::get('menu',['as' => 'Home.Page.menu', 'uses' => 'HomeController@menu']);
    Route::get('content',['as' => 'Home.Page.content', 'uses' => 'HomeController@content']);

    Route::group(['prefix'=>'admin'],function(){
        //锟斤拷锟截碉拷录页锟斤拷
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        //锟斤拷锟斤拷锟睫革拷锟斤拷锟斤拷页锟斤拷
        Route::get('changePwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        //锟斤拷锟截癸拷锟斤拷员锟叫憋拷页锟斤拷
        Route::get('admin-list',['as' => 'Admin.Home.adminList' , 'uses' => 'AdminController@adminList']);
        //锟斤拷锟截癸拷锟斤拷员锟斤拷锟斤拷页锟斤拷
        Route::get('admin-set',['as' => 'Admin.Home.adminSet' , 'uses' => 'AdminController@adminSet']);
        //锟斤拷锟斤拷banner锟叫憋拷页锟斤拷
        Route::get('banner-list',['as' => 'Admin.Home.bannerList' , 'uses' => 'AdminController@bannerList']);
        //锟斤拷锟斤拷banner锟斤拷锟斤拷锟斤拷锟睫革拷页锟斤拷
        Route::get('banner-set',['as' => 'Admin.Home.bannerSet' , 'uses' => 'AdminController@bannerSet']);
        //锟斤拷锟截诧拷品锟叫憋拷页锟斤拷
        Route::get('product-list',['as' => 'Admin.Home.productList' , 'uses' => 'AdminController@productList']);
        //锟斤拷锟截诧拷品锟斤拷锟斤拷锟斤拷锟睫革拷页锟斤拷
        Route::get('product-set',['as' => 'Admin.Home.productSet' , 'uses' => 'AdminController@productSet']);
        //锟斤拷锟截凤拷锟斤拷锟斤拷锟揭筹拷锟�
        Route::get('classify-list',['as' => 'Admin.Home.classifyList' , 'uses' => 'AdminController@classifyList']);
        //锟斤拷锟截诧拷品图片锟叫憋拷页
        Route::get('product_imgs-list',['as' => 'Admin.Home.productImgsList' , 'uses' => 'AdminController@productImgsList']);
        //锟斤拷锟截诧拷品锟斤拷锟斤拷锟斤拷锟睫革拷页锟斤拷
        Route::get('product_imgs-set',['as' => 'Admin.Home.productImgsSet' , 'uses' => 'AdminController@productImgsSet']);
        Route::get('user-list',['as' => 'Admin.Home.userList' , 'uses' => 'AdminController@userList']);
        Route::get('home_img-list',['as' => 'Admin.Home.homeImgList' , 'uses' => 'AdminController@homeImgList']);
        Route::get('home_img-set',['as' => 'Admin.Home.homeImgSet' , 'uses' => 'AdminController@homeImgSet']);

    });

    Route::group(['prefix'=>'api', 'namespace'=>'Api'],function(){

        Route::group(['prefix' => 'product'],function(){
            Route::get('banner-list',['as'=>'Api.Product.getBannerList','uses'=>'ProductController@getBannerList']);
            Route::get('get-classify-list',['as'=>'Api.Product.getClassifyList','uses'=>'ProductController@getClassifyList']);
            Route::get('get-product-list',['as'=>'Api.Product.getProductList','uses'=>'ProductController@getProductList']);
            Route::get('get-home-img',['as'=>'Api.Product.getHomeImg','uses'=>'ProductController@getHomeImg']);
        });

        Route::group(['prefix' => 'wx'],function(){
            Route::any('index',['as'=>'Api.Wechat.index','uses'=>'WechatController@index']);
        });

        Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
            Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
            Route::post('auth/change-pwd',['as'=>'Api.Admin.Auth.changePassword','uses'=>'AuthController@changePassword']);
            Route::get('signOut', ['as'=>'Api.Admin.Auth.signOut', 'uses'=>'AuthController@signOut']);
            Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
            Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
            Route::post('sys/addClassify',['as'=>'Api.Admin.sys.addClassify','uses'=>'SystemController@addClassify']);
            Route::post('sys/delClassify',['as'=>'Api.Admin.sys.delClassify','uses'=>'SystemController@delClassify']);
            Route::post('sys/setProduct',['as'=>'Api.Admin.sys.setProduct','uses'=>'SystemController@setProduct']);
            Route::post('sys/delProduct',['as'=>'Api.Admin.sys.delProduct','uses'=>'SystemController@delProduct']);
            Route::post('sys/setProductImgs',['as'=>'Api.Admin.sys.setProductImgs','uses'=>'SystemController@setProductImgs']);
            Route::post('sys/delProductImgs',['as'=>'Api.Admin.sys.delProductImgs','uses'=>'SystemController@delProductImgs']);
            Route::post('sys/setAdmin',['as' => 'Api.Admin.sys.setAdmin','uses' => 'SystemController@setAdmin']);
            Route::post('sys/setHomeImg',['as' => 'Api.Admin.sys.setHomeImg','uses' => 'SystemController@setHomeImg']);
            Route::post('sys/delAdmin',['as'=>'Api.Admin.sys.delAdmin','uses'=>'SystemController@delAdmin']);
            Route::post('sys/changeUserStatus',['as'=>'Api.Admin.sys.changeUserStatus','uses'=>'SystemController@changeUserStatus']);
            Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
        });

        Route::group(['prefix' => 'file'],function(){
            Route::post('upload-image',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
            Route::post('upload-video',['as'=>'Api.File.uploadVideo','uses'=>'ImageController@uploadVideo']);
            Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
            Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        });

        Route::group(['prefix' => 'auth'],function(){
            Route::any('wxLogin',['as'=>'Api.Auth.wxLogin','uses'=>'AuthController@wxLogin']);
            Route::get('checkUser',['as'=>'Api.Auth.checkUser','uses'=>'AuthController@checkUser']);
        });
    });
});
